public class Demo8 {
    public static void main(String[] args) {
        int[] array = {2,6,4,1};
        System.out.println(threeConsecutiveOdds(array));
    }
        public static boolean threeConsecutiveOdds(int[] arr) {;
            for (int i = 0 ;i <= arr.length -3 ;i ++){
                if (arr[i] % 2 != 0 && arr[i+1] % 2 != 0 && arr[i+2] % 2 !=0){
                    return true;
                }
            }
            return false;
        }
    }
